package com.e2oto.seller.modules.seller.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.e2oto.seller.R;
import com.e2oto.seller.modules.seller.bean.GoodsInfoBean;
import com.zhy.view.flowlayout.FlowLayout;
import com.zhy.view.flowlayout.TagAdapter;

import java.util.List;

/**
 * Created by ZhangLiQiang on 2017/11/27.
 */

public class SpecTagAdapter extends TagAdapter<GoodsInfoBean.SpecArrayBean> {
    private Context mContext;
    private List<GoodsInfoBean.SpecArrayBean> data;

    public SpecTagAdapter(List<GoodsInfoBean.SpecArrayBean> data, Context mContext) {
        super(data);
        this.mContext = mContext;
        this.data = data;
    }


    @Override
    public View getView(FlowLayout parent, int position, GoodsInfoBean.SpecArrayBean bean) {
        View view = View.inflate(mContext, R.layout.item_spec_tag, null);
        TextView tv = (TextView) view.findViewById(R.id.item_spec_tv);
        tv.setText(bean.getWeight() + bean.getUnit() + "  ¥" + bean.getSell_price());
        return view;
    }

    public List<GoodsInfoBean.SpecArrayBean> getDataList() {
        return data;
    }
}
